import pygame as pygame

import baidu_client

client = baidu_client.speech;

result = client.synthesis('你好百度', 'zh', 1, {
    'vol': 5,
})
print(result)
pygame.mixer.init()
# 加载音乐
pygame.mixer.music.load(result)
pygame.mixer.music.play(start=0.0)
# 播放时长，没有此设置，音乐不会播放，会一次性加载完
pygame.time.sleep(10)
pygame.mixer.music.stop()
